<?php
/**
 * Created by PhpStorm.
 * User: khanhdoan
 * Date: 11/14/14
 * Time: 11:27 AM
 */
class Accounts extends Public_Controller
{
    function Accounts()
    {
        parent::Public_Controller();
        $this->load->library('rest_caller');
    }
    function login() {
        $array = array(
            'email' => 'khanhdq119@gmail.com',
            'password' => 123456
        );
        //$url = '/crm/api/auth/test';
        $url = '/api/auth/test';
        $keyPath = APPPATH.'ext_libraries/key/server.key';
        $signature = $this->rest_caller->makeSignature('POST', $url, '', $array, $keyPath);
        //var_dump($signature);
        //die();
        $url = $url.'?signature='.$signature;
        $result= $this->rest_caller->post($url, $array);
        var_dump($result);
    }
}